#pragma once
#include "EXEdit.h"
#include "EXIPAddressCtrlResSet.h"
// CEXIPAddressCtrl

class AFX_EXT_CLASS CEXIPAddressCtrl : public CIPAddressCtrl
{
	DECLARE_DYNAMIC(CEXIPAddressCtrl)

public:
  enum IPADDRESS_STYLE
  {
    NOIMAGE,
    IPADDRESS_CTRL = 22,
  };
	CEXIPAddressCtrl();
	virtual ~CEXIPAddressCtrl();

	BOOL SetBitmaps(UINT nBkgndID, UINT nEditID, int nCount, COLORREF crBkgnd, 
                 int nTopHeight = 0, int nBottomHeight = 0, 
                 int nLeftWidth = 0, int nRightWidth = 0);

	BOOL InitBgBitmap(CBitmap & src, int index, int count);
	void DrawFrame(CDC * pDC);
	BOOL EnableWindow(BOOL bEnable = TRUE);
	void SetFont(CFont* pFont, BOOL bRedraw = TRUE);


	enum STATUS
	{
		normal,
		focus,
		select,
		disable
	};

	UINT m_nEditID;
	BOOL m_bSetBitmap;

	int m_nTopHeight;
	int m_nBottomHeight;
	int m_nLeftWidth;
	int m_nRightWidth;
	UINT m_nBkgndID;
	int m_nNumOfBgPics;
	COLORREF m_crBkgnd;
	CBitmap m_bmpBkgnd;
	BOOL m_bFocus;

	CEXEdit m_edFirst;
	CEXEdit m_edSecond;
	CEXEdit m_edThird;
	CEXEdit m_edFourth;

	CFont m_ft;

  void SetResSet(CEXBaseResSet* pResSet);
  CEXIPAddressCtrlResSet* m_pIPResSet;

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
public:
	afx_msg void OnDestroy();
};


